Skip to content

Conversation

@visitani
Copy link
Contributor

@visitani visitani commented Oct 1, 2025

Amazon Bedrock AgentCore Samples Pull Request

Important

  1. We strictly follow a issue-first approach, please first open an issue relating to this Pull Request.
  2. Once this Pull Request is ready for review please attach review ready label to it. Only PRs with review ready will be reviewed.

Issue number:

Concise description of the PR

Changes to ..., because ...

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • Add your name to CONTRIBUTORS.md
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you uploading a dataset?
  • Have you documented Introduction, Architecture Diagram, Prerequisites, Usage, Sample Prompts, and Clean Up steps in your example README?
  • I agree to resolve any issues created for this example in the future.
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

@github-actions github-actions bot added 01-tutorials 01-tutorials 04-AgentCore-memory 01-tutorials/04-AgentCore-memory labels Oct 1, 2025
}

// Get current AWS region
let region = 'us-east-1';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like its hard coded, please confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the hardcode logic

Comment on lines 1081 to 1091
return {
"memory_id": memory_id,
"namespaces": found_namespaces,
"total_found": len(found_namespaces),
"method": "fallback_pattern_based",
"message": f"Found {len(found_namespaces)} namespaces using fallback method (get_memory_strategies failed: {str(e)})"
}

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminated all information exposure through exceptions

Comment on lines 1127 to 1136
return {
"valid": False,
"memory_id": query.memory_id,
"accessible": False,
"message": f"Memory ID validation failed: {str(e)}"
}

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminated all information exposure through exceptions

@github-actions
Copy link

github-actions bot commented Oct 2, 2025

Latest scan for commit: e181c9d | Updated: 2025-10-17 19:19:34 UTC

Security Scan Results

Scan Metadata

  • Project: ASH
  • Scan executed: 2025-10-17T19:19:23+00:00
  • ASH version: 3.0.0

Summary

Scanner Results

The table below shows findings by scanner, with status based on severity thresholds and dependencies:

Column Explanations:

Severity Levels (S/C/H/M/L/I):

  • Suppressed (S): Security findings that have been explicitly suppressed/ignored and don't affect the scanner's pass/fail status
  • Critical (C): The most severe security vulnerabilities requiring immediate remediation (e.g., SQL injection, remote code execution)
  • High (H): Serious security vulnerabilities that should be addressed promptly (e.g., authentication bypasses, privilege escalation)
  • Medium (M): Moderate security risks that should be addressed in normal development cycles (e.g., weak encryption, input validation issues)
  • Low (L): Minor security concerns with limited impact (e.g., information disclosure, weak recommendations)
  • Info (I): Informational findings for awareness with minimal security risk (e.g., code quality suggestions, best practice recommendations)

Other Columns:

  • Time: Duration taken by each scanner to complete its analysis
  • Action: Total number of actionable findings at or above the configured severity threshold that require attention

Scanner Results:

  • PASSED: Scanner found no security issues at or above the configured severity threshold - code is clean for this scanner
  • FAILED: Scanner found security vulnerabilities at or above the threshold that require attention and remediation
  • MISSING: Scanner could not run because required dependencies/tools are not installed or available
  • SKIPPED: Scanner was intentionally disabled or excluded from this scan
  • ERROR: Scanner encountered an execution error and could not complete successfully

Severity Thresholds (Thresh Column):

  • CRITICAL: Only Critical severity findings cause scanner to fail
  • HIGH: High and Critical severity findings cause scanner to fail
  • MEDIUM (MED): Medium, High, and Critical severity findings cause scanner to fail
  • LOW: Low, Medium, High, and Critical severity findings cause scanner to fail
  • ALL: Any finding of any severity level causes scanner to fail

Threshold Source: Values in parentheses indicate where the threshold is configured:

  • (g) = global: Set in the global_settings section of ASH configuration
  • (c) = config: Set in the individual scanner configuration section
  • (s) = scanner: Default threshold built into the scanner itself

Statistics calculation:

  • All statistics are calculated from the final aggregated SARIF report
  • Suppressed findings are counted separately and do not contribute to actionable findings
  • Scanner status is determined by comparing actionable findings to the threshold
Scanner S C H M L I Time Action Result Thresh
bandit 0 1 0 0 3 0 1.0s 1 FAILED MED (g)
cdk-nag 0 0 0 0 0 0 29.3s 0 PASSED MED (g)
cfn-nag 0 0 0 0 0 0 11ms 0 PASSED MED (g)
checkov 0 0 0 0 0 0 4.9s 0 PASSED MED (g)
detect-secrets 0 0 0 0 0 0 1.0s 0 PASSED MED (g)
grype 0 0 0 0 0 0 30.9s 0 PASSED MED (g)
npm-audit 0 0 0 0 0 0 167ms 0 PASSED MED (g)
opengrep 0 0 0 0 0 0 <1ms 0 SKIPPED MED (g)
semgrep 0 0 0 0 0 0 15.9s 0 PASSED MED (g)
syft 0 0 0 0 0 0 1.8s 0 PASSED MED (g)

Detailed Findings

Show 1 actionable findings

Finding 1: B104

  • Severity: HIGH
  • Scanner: bandit
  • Rule ID: B104
  • Location: 01-tutorials/04-AgentCore-memory/03-advanced-patterns/03-memory-browser/backend/app.py:1297-1298

Description:
Possible binding to all interfaces.

Code Snippet:

import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)

Report generated by Automated Security Helper (ASH) at 2025-10-17T19:19:17+00:00

@visitani visitani force-pushed the feature/agentcore-memory-browser branch from 3fa6c02 to 7a40903 Compare October 14, 2025 04:39
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added 01-AgentCore-runtime 01-tutorials/01-AgentCore-runtime 05-AgentCore-tools 01-tutorials/05-AgentCore-tools 06-AgentCore-observability 01-tutorials/06-AgentCore-observability 07-AgentCore-E2E 01-tutorials/07-AgentCore-E2E 03-integrations 03-integrations labels Oct 14, 2025
@visitani visitani force-pushed the feature/agentcore-memory-browser branch from d50e194 to c42af18 Compare October 17, 2025 18:02
@github-actions github-actions bot removed 01-AgentCore-runtime 01-tutorials/01-AgentCore-runtime 05-AgentCore-tools 01-tutorials/05-AgentCore-tools 06-AgentCore-observability 01-tutorials/06-AgentCore-observability 07-AgentCore-E2E 01-tutorials/07-AgentCore-E2E 03-integrations 03-integrations labels Oct 17, 2025
Comment on lines +919 to +924
return {
"memories": [],
"total_count": 0,
"source": "list_memory_records",
"error": f"Failed to access namespace '{query.namespace}': {clean_error}"
}

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Comment on lines +1095 to +1099
return {
"namespaces": [],
"total_found": 0,
"error": f"Both get_memory_strategies and fallback failed: {clean_aws_error_message(str(e))} / {clean_aws_error_message(str(e2))}"
}

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
Stack trace information
flows to this location and may be exposed to an external user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

01-tutorials 01-tutorials 04-AgentCore-memory 01-tutorials/04-AgentCore-memory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants